<?
require("config.php");

if ($p=="news") $table = "med_news";

if ($p=="news1") $table = "med_news1";

if ($p=="events") $table = "med_events";

if ($p=="newsletter") $table = "med_newsletter";

if ($p=="promotion") $table = "med_promotion";

if ($p=="announcement") $table = "med_announcement";

if ($p=="trainer_sharing_detail") $table = "course_trainer_sharing";


$field = array(

"id",
"date",
"subject",
"details",
"picture1",
"picture2",
"picture3",

);

if ($p=="newsletter") {

$field = array(

"id",
"date",
"subject",
"details",
"picture1",

);

}

if ($p=="announcement") {

$field = array(

"id",
"mydate",
"subject",
"details",
"picture",

);

}

if ($p=="trainer_sharing_detail") {

$field = array(

"id",
"date",
"name",
"details",
"picture1",
"picture2",
"picture3",

);

}



$exp = "AND id = $id ";
$r = unlimitQuery($table,$field,$exp);

$Date = $r[0][1];
$Subject = $r[0][2];
$Details = $r[0][3];




?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>
<?=$Subject?>
</title>
</head>

<body onLoad="window.print();">
<table border=0 width=640 cellpadding=0 cellspacing=1>
  <tr>
    <td><img src="images/logo1.gif" width="162" height="108"></td>
    <td align="right"><font face="arial" size="2">
      <?=date("Y-m-d H:i")?>
      &nbsp;&nbsp;&nbsp;</font></td>
  </tr>
</table>
<table border=0 width=640 cellpadding=0 cellspacing=1 bgcolor="#000000">
  <tr>
    <td><table border=0 width=640 cellpadding=20 cellspacing=1 bgcolor="#FFFFFF">
        <tr>
          <td><font face="Times New Roman" size="3">
            <p align = "center"><b>
              <?=$Subject?>
              </b></p>
            <p align = "center">(
              <?

if ($p=="announcement") echo $r[0][1];
else echo outDate($r[0][1]);

?>
              )</p>
            <table>
              <tr>
                <td valign="top"><a href="<?=$PIC_DIR . "$table/" . $r[0][4]?>" target="_blank">
                  <?=showPic($PIC_DIR . "$table/sm_" . $r[0][4],"")?>
                  </a><br>
                  <a href="<?=$PIC_DIR . "$table/" . $r[0][5]?>" target="_blank">
                  <?=showPic($PIC_DIR . "$table/sm_" . $r[0][5],"")?>
                  </a><br>
                  <a href="<?=$PIC_DIR . "$table/" . $r[0][6]?>" target="_blank">
                  <?=showPic($PIC_DIR . "$table/sm_" . $r[0][6],"")?>
                  </a> </td>
                <td valign="top"><?=$r[0][3]?>
                </td>
              </tr>
            </table>
            <p>&nbsp;</p>
            </font> </td>
        </tr>
      </table></td>
  </tr>
</table>
<table border=0 width=640 cellpadding=20 cellspacing=1 bgcolor="#FFFFFF">
  <tr>
    <td><br>
      <p align="center"> <a href="http://www.acuityworld.com" target="_blank"><font face="arial">http://www.acuityworld.com</font></a> </p></td>
  </tr>
</table>
</body>
</html>
